package hari2.latihan;

import java.io.BufferedReader;
import java.io.BufferedWriter;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;

public class SumFixed {
	public static void main(String[] args) throws Exception{
		BufferedReader input = new BufferedReader(new FileReader("src/hari2/latihan/sum.data"));
		
		String line = input.readLine();
		double dt1 = Double.parseDouble(line);
		line = input.readLine();
		double dt2 = Double.parseDouble(line);
		double sum = dt1 + dt2;
		
		System.out.println("sum of " + dt1 + " plus " + dt2 + " is " + sum);
		
		PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter("src/hari2/latihan/sum.result")));
		
		output.println("sum of " + dt1 + " plus " + dt2 + " is " + sum);
		output.close();
	}
}
